#pragma once


#include <vector>
#include <map>
#include "meshType.h"
#include "parserHelper.h"
#include <iostream>



namespace MeshUtils {

class ObjParser
{
	private:
		const char* filename;
	public:
		inline ObjParser(const char* file) : filename(file) {};
		void load(std::vector<MeshUtils::Vector3>& nodes, std::vector<MeshUtils::Vector3>& normal, std::vector<MeshUtils::Vector3>& normals, std::vector<MeshUtils::Face_t>& faces, unsigned int& nbNodes, unsigned int& nbNorm, unsigned int& nbFaces);

	private:
		bool parseNode(std::ifstream& source, double& x, double& y, double& z);
		bool parseFace(std::ifstream& source, unsigned int& A, unsigned int& B, unsigned int& C,
		unsigned int& nA, unsigned int& nB, unsigned int& nC,
		unsigned int& tA, unsigned int& tB, unsigned int& tC);
};
}//namespace
